module.exports.plugin = schame => {
	schame.add({
		created: {
			type: Date,
			default: new Date()
		},
		status: {
			type: Number,
			default: 0
		},
		updated: {
			type: Date,
			default: new Date()
		},
		deleted: {
			type: Date,
			default: null
		}
	});

	schame.pre("save", next => {
		if (!this.created) {
			this.created = new Date();
			this.status = 0;
		}
		this.updated = new Date();
		next();
	});
};
